Repository navigation
routing: snap CH ends onto roads, keep a parked car's heading - #40
Merged
Merged
Conversation
A point between the two carriageways of a dual carriageway (Khreshchatyk, the default origin without a fix) started on whichever side had a CH junction nearby, and a route could begin the wrong way round: 9.1 km where A* found 4.7 km. - CH: start and end are projected onto the nearest road segments, as the core's routers do (findRouteSegment), then followed in the road's travel direction to the first sidecar junction; every such junction seeds the one search with the snap distance and the driving time to it (plus the reverse-heading penalty). The approach and exit stretches are part of the route; start and end on one road use the road itself. The nearest-junction snap stays as the fallback. - A junction splits into one node per arriving and leaving edge, all at its coordinates, so the old "4 nearest nodes" were often one junction. - The heading a route starts with is kept while the car stands where it stopped, also across a restart: a parked record (heading and position, /datastore/navicore-backend/parked.txt) is saved once per stop at a new spot and restored at start-up, also as the map's first position. Bench, 18 pairs against plain A* (2 disputed, 8 on roads, 8 jittered 15-40 m): worst CH/A* time x2.13 -> x1.29, median x0.996 -> x0.980; the disputed pair 9.1 km -> 1.5 km. CH route time median 458 -> 606 ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause of the CH vs HH/A* disagreement on the Khreshchatyk pair: the point lies between the two one-way carriageways; CH snapped to the 4 nearest nodes (a split junction is several nodes at one spot) and could start the wrong way round (9.1 km vs A* 4.7 km).
findRouteSegment, followed in travel direction to the first sidecar junction; all such junctions seed the single search (snap distance + driving time + reverse-heading penalty). Approach/exit stretches are part of the route; same-road start/end uses the road directly. Node snap remains the fallback./datastore/navicore-backend/parked.txt, saved once per stop at a new spot; also the map's first position).Bench on M9304002366, 18 pairs vs plain A* (2 disputed, 8 on-road, 8 jittered 15-40 m): worst CH/A* time x2.13 → x1.29, median x0.996 → x0.980; disputed pair 9.1 km → 1.5 km; CH median 458 → 606 ms. Remaining worst (on-road pair, x1.29) is the CH cost model, not snapping.
Tests:
make test34/34 (new parked-heading andnodes_attests),make(QNX).🤖 Generated with Claude Code